package src.service;

import src.bean.HbaseMap;

import java.util.List;
import java.util.Map;


public interface HbaseOperationService {

    /**
     * 根据表名和rowkey查询数据
     *
     * @param tableName
     * @param rowkey
     * @return
     */
    public List<HbaseMap> selectByTableNameAndRowkey(String tableName, String rowkey);

    public List<HbaseMap> scanTable(String tableName);

    public boolean disableTable(String tableName);

    public boolean enableTable(String tableName);

    public boolean dropTable(String tableName);

    /**
     * 根据rowkey和表名删除所有相关数据
     *
     * @param tableName
     * @param rowkey
     * @return
     */
    public boolean deleteTableByRowkey(String tableName, String rowkey);

    /**
     * 创建表，列族默认为f1
     *
     * @param tableName
     * @return
     */
    public boolean createTable(String tableName);

    public List<String> getTableList();

    /**
     * 插入或修改数据
     *
     * @param tableName,rowkey,column,value
     * @return boolean
     */

    public boolean insertData(String tableName, String rowkey, String column, String value);


    /**
     * 批量插入或修改
     *
     * @param tableName
     * @param list(rowkey:xxx,column:xxx,value:xxx)
     */
    public boolean insertDatas(String tableName, List<Map> list);

    public boolean createTableSpace(String spaceName);

    public boolean deleteTableSpace(String spaceName);

    public List<String> listTableSpace();

}
